package com.lp.guoguo.common;

public enum ResultCode {
    SUCCESS(200, "操作成功"),
    FAILED(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    
    // 用户相关错误
    USER_NOT_EXIST(1001, "用户不存在"),
    USER_LOGIN_FAILED(1002, "用户名或密码错误"),
    USER_ACCOUNT_FORBIDDEN(1003, "用户账号已被禁用"),
    USER_NOT_LOGIN(1004, "用户未登录"),
    USER_ACCOUNT_ALREADY_EXIST(1005, "用户账号已存在"),
    
    // 业务错误
    BUSINESS_ERROR(2001, "业务异常"),
    
    // 系统错误
    SYSTEM_ERROR(5000, "系统内部错误"),
    
    // 验证码相关错误
    VERIFY_CODE_EXPIRED(1010, "验证码已过期"),
    VERIFY_CODE_ERROR(1011, "验证码错误"),
    VERIFY_CODE_SEND_FAILED(1012, "验证码发送失败"),
    VERIFY_CODE_NOT_EXIST(1013, "验证码不存在"),
    VERIFY_CODE_TYPE_ERROR(1014, "验证码类型错误"),
    
    // 密码相关错误
    PASSWORD_ERROR(1020, "密码错误"),
    OLD_PASSWORD_ERROR(1021, "原密码错误"),
    
    // 邮箱相关错误
    EMAIL_SEND_FAILED(1030, "邮件发送失败"),
    EMAIL_NOT_FOUND(1031, "邮箱不存在"),
    
    // 用户相关错误
    USER_STATUS_ERROR(1006, "用户状态异常"),
    USER_DELETE_FAILED(1007, "用户删除失败"),
    
    // Token相关错误码
    TOKEN_EXPIRED(1100, "Token已过期"),
    TOKEN_INVALID(1101, "Token无效"),
    TOKEN_MISSING(1102, "Token不存在"),
    TOKEN_ERROR(1103, "Token错误"),
    
    // RSA加解密相关错误码
    RSA_ENCRYPT_ERROR(1200, "RSA加密失败"),
    RSA_DECRYPT_ERROR(1201, "RSA解密失败"),
    RSA_SIGN_ERROR(1202, "RSA签名失败"),
    RSA_VERIFY_ERROR(1203, "RSA签名验证失败"),
    RSA_KEY_ERROR(1204, "RSA密钥错误"),
    RSA_KEY_PAIR_GEN_ERROR(1205, "RSA密钥对生成失败"),
    RSA_PUBLIC_KEY_ERROR(1206, "RSA公钥无效"),
    RSA_PRIVATE_KEY_ERROR(1207, "RSA私钥无效");

    private final int code;
    private final String message;

    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
} 